package org.luxor.commons.rabbitmq.definition;


/**
 * Rabbit消息定义
 *
 * @author Mr.yan @date 2019/10/17
 */
public class MessageDefinition<T> {
    private String exchangeName;
    private String routingKey;
    private Long expirationMilliSecond;
    private T content;

    public MessageDefinition(String exchangeName, String routingKey, T content) {
        this.exchangeName = exchangeName;
        this.routingKey = routingKey;
        this.content = content;
    }

    public MessageDefinition(String exchangeName, String routingKeyPrefix, String routingKeySuffix, T content) {
        this(exchangeName, routingKeyPrefix + "." + routingKeySuffix, content);
    }

    public String getExchangeName() {
        return exchangeName;
    }

    public void setExchangeName(String exchangeName) {
        this.exchangeName = exchangeName;
    }

    public String getRoutingKey() {
        return routingKey;
    }

    public void setRoutingKey(String routingKey) {
        this.routingKey = routingKey;
    }

    public T getContent() {
        return content;
    }

    public void setContent(T content) {
        this.content = content;
    }

    public Long getExpirationMilliSecond() {
        return expirationMilliSecond;
    }

    public void setExpirationMilliSecond(Long expirationMilliSecond) {
        this.expirationMilliSecond = expirationMilliSecond;
    }

    @Override
    public String toString() {
        return "MessageDefinition{" +
                "exchangeName='" + exchangeName + '\'' +
                ", routingKey='" + routingKey + '\'' +
                ", expirationMilliSecond=" + expirationMilliSecond +
                ", content=" + content +
                '}';
    }
}
